package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.TEquipmentMapper;
import com.education.welco.pojo.TEquipment;
import com.education.welco.service.ITEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 设备 服务层实现
 *
 * @author d
 * @date 2022-06-20
 */
@RestController
public class TEquipmentServiceImpl implements ITEquipmentService {

    @Autowired
    private TEquipmentMapper tEquipmentMapper;

    /**
     * 查询设备信息
     *
     * @param id 设备ID
     * @return 设备信息
     */
    @Override
    public TEquipment selectTEquipmentById(Integer id) {
        return tEquipmentMapper.selectTEquipmentById(id);
    }

    /**
     * 查询设备列表
     *
     * @param tEquipment 设备信息
     * @return 设备集合
     */
    @Override
    public List<TEquipment> selectTEquipmentList(TEquipment tEquipment) {
        return tEquipmentMapper.selectTEquipmentList(tEquipment);
    }

    /**
     * 新增设备
     *
     * @param tEquipment 设备信息
     * @return 结果
     */
    @Override
    public int insertTEquipment(TEquipment tEquipment) {
        return tEquipmentMapper.insertTEquipment(tEquipment);
    }

    /**
     * 修改设备
     *
     * @param tEquipment 设备信息
     * @return 结果
     */
    @Override
    public int updateTEquipment(TEquipment tEquipment) {
        return tEquipmentMapper.updateTEquipment(tEquipment);
    }

    /**
     * 删除设备对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTEquipmentByIds(String ids) {
        return tEquipmentMapper.deleteTEquipmentByIds(Convert.toStrArray(ids));
    }

    @Override
    public int deleteTEquipmentById(String id) {
        return tEquipmentMapper.deleteTEquipmentById(Integer.valueOf(id));
    }
}